#include "headers.h"
#include "Comet.h"

using namespace std;

Comet* comet = 0;

void SignalCatcher(int) {
	cout << "in signal : " << comet << endl;
	if(comet) {
		cout << "stop server" << endl;
		comet->stopRunning();
		delete comet;
		exit(0);
	}
	else
		exit(1);
}

int main(int argc, char** argv) {
	signal( SIGINT, SignalCatcher);

	string cfgFile("comet.cfg");
	if(argc > 1 && argv[1])
		cfgFile = argv[1];
	comet = new Comet(cfgFile);
	comet->startRunning();
	delete comet;
	comet = 0;
	return 0;
}
